// Knockout JavaScript library v2.1.0+mbest/smart-binding/beta.6
// (c) Steven Sanderson - http://knockoutjs.com/
// License: MIT (http://www.opensource.org/licenses/mit-license.php)

(function() {var l=!0,p=null,s=!1;var t=window,u=document,fa=navigator,B=window.jQuery,C=void 0;function K(m){throw Error(m);}
function V(m){function xa(a,d,c,e){var f,g=b.a.D(function(){var h=a(d,e)||[];f?(g.Fa(),b.a.pb(Q(f),h),c(d,h,e,g),f.splice(0,f.length),b.a.R(f,h)):f=h});return{bc:f,i:g}}function ga(a,d,b,e){e&&e.$(Q(d))}function Q(a){for(;a.length&&!b.a.Xa(a[0]);)a.splice(0,1);if(1<a.length){for(var d=a[0],c=a[a.length-1],e=[d];d!==c;){d=d.nextSibling;if(!d)return;e.push(d)}Array.prototype.splice.apply(a,[0,a.length].concat(e))}return a}function ha(a,d,b,e){var f=Math.min,g=Math.max,h=[],k,w=a.length,n,z=d.length,
j=z-w||1,D=w+z+1,x,q,r;for(k=0;k<=w;k++){q=x;h.push(x=[]);r=f(z,k+j);for(n=g(0,k-1);n<=r;n++)x[n]=n?k?a[k-1]===d[n-1]?q[n-1]:f(q[n]||D,x[n-1]||D)+1:n+1:k+1}f=[];g=[];j=[];k=w;for(n=z;k||n;)w=h[k][n]-1,n&&w===h[k][n-1]?g.push(f[f.length]={status:b,value:d[--n],idx:n}):k&&w===h[k-1][n]?j.push(f[f.length]={status:e,value:a[--k],idx:k}):(f.push({status:"retained",value:d[--n]}),--k);if(g.length&&j.length)for(a=0;b=g[a];a++)for(d=0;e=j[d];d++)if(b.value===e.value){b.moved=e.idx;e.moved=b.idx;j.splice(d,
1);break}return f.reverse()}function ia(a,d,c,e,f){f=f||{};var g=a&&(a.nodeType?a:0<a.length?a[0]:p),g=g&&g.ownerDocument,h=f.templateEngine||W;b.O.Qb(c,h,g);c=h.renderTemplate(c,e,f,g);("number"!=typeof c.length||0<c.length&&"number"!=typeof c[0].nodeType)&&K("Template engine must return an array of DOM nodes");g=s;switch(d){case "replaceChildren":b.f.N(a,c);g=l;break;case "replaceNode":b.a.pb(a,c);g=l;break;case "ignoreTargetNode":break;default:K("Unknown renderMode: "+d)}g&&(ja(c,e),f.afterRender&&
f.afterRender(c,e.$data));return c}function ja(a,d){if(a.length){var c=a[0],e=a[a.length-1];ka(c,e,function(a){b.Ma(d,a)});ka(c,e,function(a){b.W.xb(a,[d])})}}function ka(a,d,c){var e;for(d=b.f.nextSibling(d);a&&(e=a)!==d;)a=b.f.nextSibling(e),(1===e.nodeType||8===e.nodeType)&&c(e)}function la(a,d,c){a=b.w.mb(a);for(var e=b.O.qa,f=0;f<a.length;f++){var g=a[f][0];if(e.hasOwnProperty(g))(g=e[g](a[f][1]))&&K(g);else{var h=b.$a(g);h&&b.Fb(h)&&K("This template engine does not support the '"+g+"' binding within its templates")}}a=
"ko.__tr_ambtns(function(){return(function(){return{"+b.w.nb(a)+"} })()})";return c.createJavaScriptEvaluatorBlock(a)+d}function X(a,d){return a&&a instanceof b.F?a:new b.F(a,p,d)}function Y(a,d,c,e,f){function g(a){return a?R(r[a]):b.a.ec(A,R)}function h(a){return a?r[a]:r}function k(a,d){K("Multiple bindings ("+a+" and "+d+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.")}function w(b){return function(){var c=(0,b.G.init)(d,
b.yb,ma,J,a);c&&(!(b.V&16)&&c.controlsDescendantBindings)&&(q?K(b.key+" binding handler must be updated to use contentBind flag"):F[2]?k(F[2].key,b.key):F[b.A=2]=b);return c&&c.subscribable}}function n(c){return function(){c.Ba&&b.a.e(c.Ba,function(a){a.u&&b.q.Y(a.u)});return(0,c.G.update)(d,c.yb,ma,J,a)}}function z(a){m&&a.G.init&&(a.u=b.q.eb(w(a)));a.G.update&&(a.u=b.a.D(n(a),d)||a.u)}function j(a){a.G.update&&n(a)()}var D=1===d.nodeType,x=e||b.K.instance.nodeHasBindings(d),q=a.$options.independentBindings;
D&&b.f.kb(d);c&&(D||x)&&b.tb(d,a);if(x){var r,A={},J=a.$data,m=l,E=b.a.D(function(){b.c[S]=ya;r=("function"==typeof e?e():e)||b.K.instance.getBindings(d,a);if(q&&!m)for(var c in A)A[c]=r[c];r&&a.B&&b.q.Y(a.B)},d);q&&(E&&(!a.B||1<E.ab()))&&K("In independent mode, binding provider must not access any observables.");var ma=q?g:h,v=q?z:j,y=[],F=[[],[],C,[]];b.a.D(function(){if(m){var c={},e=r&&r[S]||{},g=0,h,n=function(a){if(a in c)return y[c[a]];var d,f=b.c[a];if(d=f?{G:f,key:a}:na(a)){var f=d.G,g;d.V=
f.flags;!D&&(!b.f.La[d.key]&&!(d.V&64))&&K("The binding '"+d.key+"' cannot be used with virtual elements");var h=d.pc;d.yb=h?function(){E&&E();var d={};d[h]=R(r[a]);return d}:function(){E&&E();return R(r[a])};!q&&f.init&&w(d)();d.V&16?(F[2]&&k(F[2].key,d.key),F[d.A=2]=d,g=1):g=d.A=d.V&8?1:d.V&32?3:0;if(f[S]||e[a])c[a]=-1,d.Ba=[],b.a.e([].concat(f[S]||[],e[a]||[]),function(b){var c;(!(b in r)||!(c=n(b)))&&K("Binding "+a+" cannot 'need' "+b+": missing or recursive");d.A?c.A<=d.A?c.Ua=Math.min(c.Ua||
3,g):K("Binding "+a+" cannot 'need' "+b+": conflicting ordering"):d.A=c.A;d.Ba.push(c)});c[a]=y.push(d)-1;return d}q&&(A[a]=r[a])};for(h in r)n(h);for(var z=0,j;j=y[z];++z)2==j.A?h=3:(h=j.A||j.Ua||g,F[h].push(j)),h>g&&(g=h)}!q&&E&&E();b.a.e(F[0],v);b.a.e(F[1],v);F[2]?v(F[2]):f||Z(a,d,!D);b.a.e(F[3],v)},d);m=f=s}else f||Z(a,d,!D)}function Z(a,d,c){for(var e=b.f.firstChild(d);d=e;)e=b.f.nextSibling(d),Y(a,d,c)}function R(a){return a&&a.zb===b.ra?a():a}function na(a,d){var c=a.indexOf(".");if(0<c){var e=
a.substring(0,c),f=b.c[e];if(f)return f.flags&4||K(e+" does not support two-level binding"),d?f:{key:e,pc:a.substring(c+1),G:f}}}function oa(a,d){var b=pa(a,d);return b?0<b.length?b[b.length-1].nextSibling:a.nextSibling:p}function pa(a,d){for(var b=a,e=1,f=[];b=b.nextSibling;){if(T(b)&&(e--,0===e))return f;f.push(b);y(b)&&e++}d||K("Cannot find closing comment tag to match: "+a.nodeValue);return p}function T(a){return 8==a.nodeType&&(U?a.text:a.nodeValue).match(za)}function y(a){return 8==a.nodeType&&
(U?a.text:a.nodeValue).match(Aa)}function $(a){var d=b.a.ia(a);123===d.charCodeAt(0)&&(d=d.slice(1,-1));a=[];var d=d.match(Ba),c,e,f=0;if(d){d.push(",");for(var g=0,h=d.length;g<h;++g){var k=d[g],w=k.charCodeAt(0);if(44===w){if(0>=f){c&&a.push([c,e?e.join(""):C]);c=e=f=0;continue}}else if(58===w){if(!e)continue}else if(40===w||123===w||91===w)++f;else if(41===w||125===w||93===w)--f;else if(!c){c=34===w||39===w?k.slice(1,-1):k;continue}e?e.push(k):e=[k]}}return a}function Ca(){var a=[],d=[];this.save=
function(c,e){var f=b.a.h(a,c);0<=f?d[f]=e:(a.push(c),d.push(e))};this.get=function(c){c=b.a.h(a,c);return 0<=c?d[c]:C}}function qa(a,d,b){function e(e){var g=d(a[e]);switch(typeof g){case "boolean":case "number":case "string":case "function":f[e]=g;break;case "object":case "undefined":var h=b.get(g);f[e]=h!==C?h:qa(g,d,b)}}b=b||new Ca;a=d(a);if(!("object"==typeof a&&a!==p&&a!==C&&!(a instanceof Date)))return a;var f=a instanceof Array?[]:{};b.save(a,f);var g=a;if(g instanceof Array){for(var h=0;h<
g.length;h++)e(h);"function"==typeof g.toJSON&&e("toJSON")}else for(h in g)e(h);return f}function ra(a,d){if(a)if(8==a.nodeType){var c=b.W.lb(a.nodeValue);c!=p&&d.push({Nb:a,cc:c})}else if(1==a.nodeType)for(var c=0,e=a.childNodes,f=e.length;c<f;c++)ra(e[c],d)}function aa(a,d){if("input"!==j.p(a)||!a.type||"click"!=d.toLowerCase())return s;var b=a.type;return"checkbox"==b||"radio"==b}function ba(a){function d(d){return function(){var e={templateEngine:b.L.hb};a(d(),e);return e}}return{flags:80,init:function(a,
e){return b.c.template.init(a,d(e))},update:function(a,e,f,g,h){return b.c.template.update(a,d(e),f,g,h)}}}var b="undefined"!==typeof m?m:{};b.b=function(a,d){for(var c=a.split("."),e=b,f=0;f<c.length-1;f++)e=e[c[f]];e[c[c.length-1]]=d};b.Rb=function(a,d){a.dispose=d};b.C=function(a){for(var d=1,b=arguments,e=b.length-1;d<e;d+=2)a[b[d]]=b[d+1];return a};b.version="2.1.0+mbest/smart-binding/beta.6";b.b("version",b.version);m=b;var v,Da=/^[\s\u00A0]+|[\s\u00A0]+$/g,H={},sa={};H[/Firefox\/2/i.test(fa.userAgent)?"KeyboardEvent":
"UIEvents"]=["keyup","keydown","keypress"];H.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" ");for(v in H){var O=H[v];if(O.length)for(var ca=0,Ea=O.length;ca<Ea;ca++)sa[O[ca]]=v}var Fa={propertychange:l},L;v=3;H=u.createElement("div");for(O=H.getElementsByTagName("i");H.innerHTML="\x3c!--[if gt IE "+ ++v+"]><i></i><![endif]--\x3e",O[0];);L=4<v?v:C;var j={Za:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],e:function(a,b){for(var c=
0,e=a.length;c<e;c++)b(a[c])},h:function(a,b){if("function"==typeof Array.prototype.indexOf)return Array.prototype.indexOf.call(a,b);for(var c=0,e=a.length;c<e;c++)if(a[c]===b)return c;return-1},Oa:function(a,b,c){for(var e=0,f=a.length;e<f;e++)if(b.call(c,a[e]))return a[e];return p},S:function(a,b){var c=j.h(a,b);0<=c&&a.splice(c,1)},Pa:function(a){a=a||[];for(var b=[],c=0,e=a.length;c<e;c++)0>j.h(b,a[c])&&b.push(a[c]);return b},ba:function(a,b){a=a||[];for(var c=[],e=0,f=a.length;e<f;e++)c.push(b(a[e]));
return c},pa:function(a,b){a=a||[];for(var c=[],e=0,f=a.length;e<f;e++)b(a[e])&&c.push(a[e]);return c},R:function(a,b){if(b instanceof Array)a.push.apply(a,b);else for(var c=0,e=b.length;c<e;c++)a.push(b[c]);return a},j:function(a){for(var b=1,c,e;c=arguments[b];b++)for(e in c)c.hasOwnProperty(e)&&(a[e]=c[e]);return a},ec:function(a,b){var c={},e;for(e in a)a.hasOwnProperty(e)&&(c[e]=b(a[e]));return c},va:function(a){for(;a.firstChild;)b.T(a.firstChild)},jb:function(a){a=j.H(a);for(var d=u.createElement("div"),
c=0,e=a.length;c<e;c++)b.ca(a[c]),d.appendChild(a[c]);return d},Sa:function(a){for(var b=0,c=a.length,e=[];b<c;b++)e.push(a[b].cloneNode(l));return e},N:function(a,b){j.va(a);if(b)for(var c=0,e=b.length;c<e;c++)a.appendChild(b[c])},pb:function(a,d){var c=a.nodeType?[a]:a;if(0<c.length){for(var e=c[0],f=e.parentNode,g=0,h=d.length;g<h;g++)f.insertBefore(d[g],e);g=0;for(h=c.length;g<h;g++)b.T(c[g])}},sb:function(a,b){0<=fa.userAgent.indexOf("MSIE 6")?a.setAttribute("selected",b):a.selected=b},ia:function(a){return(a||
"").replace(Da,"")},vc:function(a,b){for(var c=[],e=(a||"").split(b),f=0,g=e.length;f<g;f++){var h=j.ia(e[f]);""!==h&&c.push(h)}return c},oc:function(a,b){a=a||"";return b.length>a.length?s:a.substring(0,b.length)===b},Eb:function(a,b){for(var c="return ("+a+")",e=0;e<b;e++)c="with(sc["+e+"]) { "+c+" } ";return new Function("sc",c)},Ob:function(a,b){if(b.compareDocumentPosition)return 16==(b.compareDocumentPosition(a)&16);for(;a!=p;){if(a==b)return l;a=a.parentNode}return s},Xa:function(a){return j.Ob(a,
a.ownerDocument)},p:function(a){return a&&a.tagName&&a.tagName.toLowerCase()},o:function(a,b,c){var e=L&&Fa[b];if(!e&&"undefined"!=typeof B){if(aa(a,b)){var f=c;c=function(a,b){var d=this.checked;b&&(this.checked=b.Gb!==l);f.call(this,a);this.checked=d}}B(a).bind(b,c)}else!e&&"function"==typeof a.addEventListener?a.addEventListener(b,c,s):"undefined"!=typeof a.attachEvent?a.attachEvent("on"+b,function(b){c.call(a,b)}):K("Browser doesn't support addEventListener or attachEvent")},ka:function(a,b){(!a||
!a.nodeType)&&K("element must be a DOM node when calling triggerEvent");if("undefined"!=typeof B){var c=[];aa(a,b)&&c.push({Gb:a.checked});B(a).trigger(b,c)}else"function"==typeof u.createEvent?"function"==typeof a.dispatchEvent?(c=u.createEvent(sa[b]||"HTMLEvents"),c.initEvent(b,l,l,t,0,0,0,0,0,s,s,s,s,0,a),a.dispatchEvent(c)):K("The supplied element doesn't support dispatchEvent"):"undefined"!=typeof a.fireEvent?(aa(a,b)&&(a.checked=a.checked!==l),a.fireEvent("on"+b)):K("Browser doesn't support triggering events")},
d:function(a){return b.xa(a)?a():a},D:function(a,d,c){return b.i(a,p,{qb:l,Kb:d,Mb:c})},ja:function(a,b,c){if(b){var e=/[\w-]+/g,f=a.className.match(e)||[];j.e(b.match(e),function(a){var b=j.h(f,a);0<=b?c||f.splice(b,1):c&&f.push(a)});a.className=f.join(" ")}},Pb:function(a){if(9<=L){var b=a.style.width;a.style.width=0;a.style.width=b}},ic:function(a,b){a=j.d(a);b=j.d(b);for(var c=[],e=a;e<=b;e++)c.push(e);return c},H:function(a){for(var b=[],c=0,e=a.length;c<e;c++)b.push(a[c]);return b},Yb:6===L,
Zb:7===L,ea:L,bb:function(a,b){for(var c=j.H(a.getElementsByTagName("input")).concat(j.H(a.getElementsByTagName("textarea"))),e="string"==typeof b?function(a){return a.name===b}:function(a){return b.test(a.name)},f=[],g=c.length-1;0<=g;g--)e(c[g])&&f.push(c[g]);return f},fc:function(a){return"string"==typeof a&&(a=j.ia(a))?t.JSON&&t.JSON.parse?t.JSON.parse(a):(new Function("return "+a))():p},Ha:function(a,b,c){("undefined"==typeof JSON||"undefined"==typeof JSON.stringify)&&K("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");
return JSON.stringify(j.d(a),b,c)},gc:function(a,b,c){c=c||{};var e=c.params||{},f=c.includeFields||this.Za,g=a;if("object"==typeof a&&"form"===j.p(a))for(var g=a.action,h=f.length-1;0<=h;h--)for(var k=j.bb(a,f[h]),w=k.length-1;0<=w;w--)e[k[w].name]=k[w].value;b=j.d(b);var n=u.createElement("form");n.style.display="none";n.action=g;n.method="post";for(var z in b)a=u.createElement("input"),a.name=z,a.value=j.Ha(j.d(b[z])),n.appendChild(a);for(z in e)a=u.createElement("input"),a.name=z,a.value=e[z],
n.appendChild(a);u.body.appendChild(n);c.submitter?c.submitter(n):n.submit();setTimeout(function(){n.parentNode.removeChild(n)})}};v=b.C(j,"arrayForEach",j.e,"arrayFirst",j.Oa,"arrayFilter",j.pa,"arrayGetDistinctValues",j.Pa,"arrayIndexOf",j.h,"arrayMap",j.ba,"arrayPushAll",j.R,"arrayRemoveItem",j.S,"extend",j.j,"fieldsIncludedWithJsonPost",j.Za,"getFormFields",j.bb,"possiblyWrap",j.D,"postJson",j.gc,"parseJson",j.fc,"registerEventHandler",j.o,"stringifyJson",j.Ha,"range",j.ic,"toggleDomNodeCssClass",
j.ja,"triggerEvent",j.ka,"unwrapObservable",j.d);m.a=v;b.b("utils",b.a);Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=Array.prototype.slice.call(arguments);a=c.shift();return function(){return b.apply(a,c.concat(Array.prototype.slice.call(arguments)))}});b.a.z=new function(){function a(a,b){var d=c(a,s);return d===C?C:d[b]}function d(a,b,d){d===C&&c(a,s)===C||(c(a,l)[b]=d)}function c(a,b){var d=a[f];if(!(d&&"null"!==d)){if(!b)return C;d=a[f]="ko"+e++;g[d]={}}return g[d]}
var e=0,f="__ko__"+(new Date).getTime(),g={};b.s=a;b.n=d;return{get:a,set:d,clear:function(a){var b=a[f];b&&(delete g[b],a[f]=p)},M:function(){return e++}}};b.b("utils.domData",b.a.z);b.b("utils.domData.clear",b.a.z.clear);b.a.Wa=new function(){function a(a,d){var c=b.s(a,e);c===C&&d&&(c=[],b.n(a,e,c));return c}function d(c,f){var h=a(c,s);if(h){for(var h=h.slice(0),z=0;z<h.length;z++)h[z](c);f&&b.n(c,e,C)}f||(b.a.z.clear(c),"function"==typeof B&&"function"==typeof B.cleanData&&B.cleanData([c]));
if(g[c.nodeType])for(z=c.firstChild;h=z;)z=h.nextSibling,8===h.nodeType&&d(h,f)}function c(a,c){if(f[a.nodeType]&&(d(a,c),g[a.nodeType])){var e=[];b.a.R(e,a.getElementsByTagName("*"));for(var h=0,j=e.length;h<j;h++)d(e[h],c)}}var e=b.a.z.M(),f={1:l,8:l,9:l},g={1:l,9:l};b.ca=c;b.T=function(a){c(a);a.parentNode&&a.parentNode.removeChild(a)};b.sc=function(a){c(a,l)};var h={Ka:function(d,c,f){function g(b){r.push(b);3!==b.nodeType&&a(b,l).push(h)}function h(a,d){d?d==c&&x(a):(b.a.S(r,a),r.length||c())}
function j(a){a.nodeType?g(a):b.a.e(a,g)}function x(d){if(3!==d.nodeType){var c=a(d,s);c&&(b.a.S(c,h),c.length||b.n(d,e,C))}b.a.S(r,d)}function q(){for(;r.length;)x(r[0])}var r=[];"function"!=typeof c&&K("Callback must be a function");d&&j(d);return{Ab:j,rc:x,Jb:q,m:function(){q();c()},nc:function(){return r.length&&!b.a.Oa(r,b.a.Xa)||f&&f()},Tb:function(){return r},tc:function(){return r.length}}},jc:function(d,c){var e=a(d,s);if(e)var f=b.a.H(e);b.a.e(f,function(a){a(d,c)})}};return b.C(h,"addDisposeCallback",
h.Ka,"removeDisposeCallback",h.jc)};b.b("cleanNode",b.ca);b.b("cleanAndRemoveNode",b.T);b.b("removeNode",b.T);b.b("utils.domNodeDisposal",b.a.Wa);b.a.Da=function(a){var d;if("undefined"!=typeof B){if((d=B.clean([a]))&&d[0]){for(a=d[0];a.parentNode&&11!==a.parentNode.nodeType;)a=a.parentNode;a.parentNode&&a.parentNode.removeChild(a)}}else{var c=b.a.ia(a).toLowerCase();d=u.createElement("div");c=c.match(/^<(thead|tbody|tfoot)/)&&[1,"<table>","</table>"]||!c.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||
(!c.indexOf("<td")||!c.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||[0,"",""];a="ignored<div>"+c[1]+a+c[2]+"</div>";for("function"==typeof t.innerShiv?d.appendChild(t.innerShiv(a)):d.innerHTML=a;c[0]--;)d=d.lastChild;d=b.a.H(d.lastChild.childNodes)}return d};b.a.ha=function(a,d){b.a.va(a);if(d!==p&&d!==C)if("string"!=typeof d&&(d=d.toString()),"undefined"!=typeof B)B(a).html(d);else for(var c=b.a.Da(d),e=0;e<c.length;e++)a.appendChild(c[e])};b.b("utils.parseHtmlFragment",b.a.Da);
b.b("utils.setHtml",b.a.ha);m=b;var da={},M={Aa:function(a){"function"!=typeof a&&K("You can only pass a function to ko.memoization.memoize()");var b=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);da[b]=a;return"\x3c!--[ko_memo:"+b+"]--\x3e"},wb:function(a,b){var c=da[a];c===C&&K("Couldn't find any memo with ID "+a+". Perhaps it's already been unmemoized.");try{return c.apply(p,b||[]),l}finally{delete da[a]}},xb:function(a,d){var c=
[];ra(a,c);for(var e=0,f=c.length;e<f;e++){var g=c[e].Nb,h=[g];d&&b.a.R(h,d);M.wb(c[e].cc,h);g.nodeValue="";g.parentNode&&g.parentNode.removeChild(g)}},lb:function(a){return(a=a.match(/^\[ko_memo\:(.*?)\]$/))?a[1]:p}};v=b.C(M,"memoize",M.Aa,"unmemoize",M.wb,"parseMemoText",M.lb,"unmemoizeDomNodeAndDescendants",M.xb);m.W=v;b.b("memoization",b.W);b.Ya={throttle:function(a,d){if(b.ya(a)){var c=p;return b.i({read:a,write:function(b){clearTimeout(c);c=setTimeout(function(){a(b)},d)}})}a.throttleEvaluation=
d;return a},notify:function(a,d){a.equalityComparer="always"==d?function(){return s}:b.k.fn.equalityComparer;return a}};b.b("extenders",b.Ya);b.ub=function(a,d,c){this.target=a;this.sa=d;this.Lb=c;b.Rb(this,this.m)};b.ub.prototype.m=function(){this.Xb=l;this.Lb()};b.u=function(){this.v={};b.a.j(this,b.u.fn);b.C(this,"subscribe",this.Ia,"extend",this.extend,"getSubscriptionsCount",this.Ub)};b.u.fn={Ia:function(a,d,c){c=c||"change";var e=this,f=new b.ub(e,d?a.bind(d):a,function(){b.a.S(e.v[c],f)});
e.v[c]||(e.v[c]=[]);e.v[c].push(f);return f},notifySubscribers:function(a,d){d=d||"change";this.v[d]&&b.a.e(this.v[d].slice(0),function(b){b&&b.Xb!==l&&b.sa(a)})},Ub:function(){var a=0,b;for(b in this.v)this.v.hasOwnProperty(b)&&(a+=this.v[b].length);return a},extend:function(a){var d=this;if(a)for(var c in a){var e=b.Ya[c];"function"==typeof e&&(d=e(d,a[c]))}return d}};b.ib=function(a){return"function"==typeof a.Ia&&"function"==typeof a.notifySubscribers};b.b("subscribable",b.u);b.b("isSubscribable",
b.ib);var I=[];b.q={Qa:function(a){I.push({sa:a,Va:[]})},end:function(){I.pop()},Y:function(a){b.ib(a)||K("Only subscribable things can act as dependencies");if(0<I.length){var d=I[I.length-1];d&&!(0<=b.a.h(d.Va,a))&&(d.Va.push(a),d.sa(a))}},eb:function(a){try{return I.push(p),a()}finally{I.pop()}}};b.b("ignoreDependencies",b.uc=b.q.eb);var Ga={undefined:l,"boolean":l,number:l,string:l};b.k=function(a){function d(){if(0<arguments.length){if(!d.equalityComparer||!d.equalityComparer(c,arguments[0]))d.J(),
c=arguments[0],d.I();return this}b.q.Y(d);return c}var c=a;b.u.call(d);d.ga=function(){return c};d.I=function(){d.notifySubscribers(c)};d.J=function(){d.notifySubscribers(c,"beforeChange")};b.a.j(d,b.k.fn);return b.C(d,"peek",d.ga,"valueHasMutated",d.I,"valueWillMutate",d.J)};b.k.fn={equalityComparer:function(a,b){return a===p||typeof a in Ga?a===b:s}};var N=b.k.hc="__ko_proto__";b.k.fn[N]=b.k;b.wa=function(a,d){return a===p||a===C||a[N]===C?s:a[N]===d?l:b.wa(a[N],d)};b.xa=function(a){return b.wa(a,
b.k)};b.ya=function(a){return"function"==typeof a&&a[N]===b.k||"function"==typeof a&&a[N]===b.i&&a.Vb?l:s};b.b("observable",b.k);b.b("isObservable",b.xa);b.b("isWriteableObservable",b.ya);b.X=function(a){0==arguments.length&&(a=[]);a!==p&&(a!==C&&!("length"in a))&&K("The argument passed when initializing an observable array must be an array, or null, or undefined.");var d=b.k(a);b.a.j(d,b.X.fn);return d};b.X.fn={remove:function(a){for(var b=this(),c=[],e="function"==typeof a?a:function(b){return b===
a},f=0;f<b.length;f++){var g=b[f];e(g)&&(0===c.length&&this.J(),c.push(g),b.splice(f,1),f--)}c.length&&this.I();return c},removeAll:function(a){if(a===C){var d=this(),c=d.slice(0);this.J();d.splice(0,d.length);this.I();return c}return!a?[]:this.remove(function(d){return 0<=b.a.h(a,d)})},destroy:function(a){var b=this(),c="function"==typeof a?a:function(b){return b===a};this.J();for(var e=b.length-1;0<=e;e--)c(b[e])&&(b[e]._destroy=l);this.I()},destroyAll:function(a){return a===C?this.destroy(function(){return l}):
!a?[]:this.destroy(function(d){return 0<=b.a.h(a,d)})},indexOf:function(a){var d=this();return b.a.h(d,a)},replace:function(a,b){var c=this.indexOf(a);0<=c&&(this.J(),this()[c]=b,this.I())}};b.a.e("pop push reverse shift sort splice unshift".split(" "),function(a){b.X.fn[a]=function(){var b=this();this.J();b=b[a].apply(b,arguments);this.I();return b}});b.a.e(["slice"],function(a){b.X.fn[a]=function(){var b=this();return b[a].apply(b,arguments)}});b.b("observableArray",b.X);b.i=function(a,d,c){function e(){b.a.e(r,
function(a){a.m()});r=[];m=s}function f(){m=l;var a=k.throttleEvaluation;a&&0<=a?(clearTimeout(A),A=setTimeout(h,a)):h()}function g(a){r.push(a.Ia(f))}function h(){if(!D&&m)if(E&&E())k.m();else{D=l;try{var a=b.a.ba(r,function(a){return a.target});b.q.Qa(function(c){var d;0<=(d=b.a.h(a,c))?a[d]=C:g(c)});for(var c=x.call(d),e=a.length-1;0<=e;e--)a[e]&&r.splice(e,1)[0].m();m=s;k.notifySubscribers(j,"beforeChange");j=c}finally{b.q.end()}k.notifySubscribers(j);D=s}}function k(){if(0<arguments.length)w.apply(k,
arguments);else return m&&h(),b.q.Y(k),j}function w(){"function"===typeof q?q.apply(d,arguments):K("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.")}function n(a){a&&(v||(v=b.a.Wa.Ka(p,e,E)),v.Ab(a),k.m=v.m,E=v.nc,y=v.Tb());return k}var j,m=l,D=s,x=a;x&&"object"==typeof x?(c=x,x=c.read):(c=c||{},x||(x=c.read));"function"!=typeof x&&K("Pass a function that returns the value of the ko.computed");var q=c.write;
d||(d=c.owner);var r=[],A=p;if(c.deferEvaluation!==l||c.qb){D=l;try{b.q.Qa(g),j=x.call(d)}finally{b.q.end()}m=D=s}if(c.qb&&!r.length)return j;k.ga=function(){m&&h();return j};var v,y=[];b.a.j(k,{Vb:"function"===typeof q,ab:function(){return r.length},$:n,Fa:function(a){v&&v.Jb();return n(a)},Sb:function(){return y.length},m:e});var E=c.Mb||c.disposeWhen;n(c.Kb||c.disposeWhenNodeIsRemoved);b.u.call(k);b.a.j(k,b.i.fn);return b.C(k,"peek",k.ga,"dispose",k.m,"getDependenciesCount",k.ab,"addDisposalNodes",
k.$,"replaceDisposalNodes",k.Fa,"getDisposalNodesCount",k.Sb)};b.Wb=function(a){return b.wa(a,b.i)};m=b.k.hc;b.i[m]=b.k;b.i.fn={};b.i.fn[m]=b.i;b.b("dependentObservable",b.i);b.b("computed",b.i);b.b("isComputed",b.Wb);b.vb=function(a){0==arguments.length&&K("When calling ko.toJS, pass the object you want to convert.");return qa(a,function(a){for(var c=0;b.xa(a)&&10>c;c++)a=a();return a})};b.toJSON=function(a,d,c){a=b.vb(a);return b.a.Ha(a,d,c)};b.b("toJS",b.vb);b.b("toJSON",b.toJSON);m=b;var P={t:function(a){switch(b.a.p(a)){case "option":return a.__ko__hasDomDataOptionValue__===
l?b.s(a,b.c.options.Ca):7>=b.a.ea?a.getAttributeNode("value").specified?a.value:a.text:a.value;case "select":return 0<=a.selectedIndex?P.t(a.options[a.selectedIndex]):C;default:return a.value}},la:function(a,d){switch(b.a.p(a)){case "option":switch(typeof d){case "string":b.n(a,b.c.options.Ca,C);"__ko__hasDomDataOptionValue__"in a&&delete a.__ko__hasDomDataOptionValue__;a.value=d;break;default:b.n(a,b.c.options.Ca,d),a.__ko__hasDomDataOptionValue__=l,a.value="number"===typeof d?d:""}break;case "select":for(var c=
a.options.length-1;0<=c;c--)if(P.t(a.options[c])==d){a.selectedIndex=c;break}break;default:if(d===p||d===C)d="";a.value=d}}};v=b.C(P,"readValue",P.t,"writeValue",P.la);m.r=v;b.b("selectExtensions",b.r);var Ha=/^[\_$a-z][\_$a-z0-9]*(\[.*?\])*(\.[\_$a-z][\_$a-z0-9]*(\[.*?\])*)*$/i,Ia=["true","false","null"],Ba=RegExp("(?:(?:\"(?:[^\"\\\\]|\\\\.)*\")|(?:'(?:[^'\\\\]|\\\\.)*')|(?:/(?:[^/\\\\]|\\\\.)*/)|(?:[^\\s:,][^,\"'{}()/:[\\]]*[^\\s,\"'{}()/:[\\]])|[^\\s])","g");b.w={mb:$,nb:function(a,d){function c(a,
d,k){var j="'"+a+"'",m=k||b.$a(a),x=m||h,q=m&&m.flags;d===C&&q&128&&(d="true");if(!k&&q&4&&"{"===d.charAt(0))d=$(d),b.a.e(d,function(b){c(a+"."+b[0],b[1],m)});else{if(m&&m.preprocess&&(d=m.preprocess(d,a,c),!d))return;if(d.match(/^[\(\s]*function\s*\(.*}[\)\s]*$/)===p){if(m&&(0<=b.a.h(Ia,d)?0:d.match(Ha)!==p))g&&q&2?(d="function(_x,_y,_z){("+d+")(_x,_y,_z);}",x=s):q&1&&f.push(j+":function(_z){"+d+"=_z;}");x&&d.match(/[^(]+\(/)!==p&&(d="ko.bindingValueWrap(function(){return "+d+"})")}e.push(j+":"+
d)}}d=d||{};var e=[],f=[],g=d.eventHandlersUseObjectForThis,h=d.independentBindings,k="string"===typeof a?$(a):a;b.a.e(k,function(a){c(a[0],a[1])});k=e.join(",");0<f.length&&(k=k+",'_ko_property_writers':{"+f.join(",")+"}");return k},ac:function(a,b){for(var c=0;c<a.length;c++)if(a[c][0]==b)return l;return s},ma:function(a,d,c,e,f){if(!a||!b.ya(a)){if((a=d("_ko_property_writers"))&&a[c])a[c](e)}else(!f||a()!==e)&&a(e)}};m=b;var U="\x3c!--test--\x3e"===u.createComment("test").text,Aa=U?/^\x3c!--\s*ko\s+(.*\:.*)\s*--\x3e$/:
/^\s*ko\s+(.*\:.*)\s*$/,za=U?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,Ja={ul:l,ol:l},G={La:{},childNodes:function(a){return y(a)?pa(a):a.childNodes},da:function(a){if(y(a)){a=G.childNodes(a);for(var d=0,c=a.length;d<c;d++)b.T(a[d])}else b.a.va(a)},N:function(a,d){if(y(a)){G.da(a);for(var c=a.nextSibling,e=0,f=d.length;e<f;e++)c.parentNode.insertBefore(d[e],c)}else b.a.N(a,d)},ob:function(a,b){y(a)?a.parentNode.insertBefore(b,a.nextSibling):a.firstChild?a.insertBefore(b,a.firstChild):a.appendChild(b)},
gb:function(a,b,c){y(a)?a.parentNode.insertBefore(b,c.nextSibling):c.nextSibling?a.insertBefore(b,c.nextSibling):a.appendChild(b)},firstChild:function(a){return!y(a)?a.firstChild:!a.nextSibling||T(a.nextSibling)?p:a.nextSibling},nextSibling:function(a){y(a)&&(a=oa(a));return a.nextSibling&&T(a.nextSibling)?p:a.nextSibling},qc:function(a){return(a=y(a))?a[1]:p},kb:function(a){if(Ja[b.a.p(a)]){var d=a.firstChild;if(d){do if(1===d.nodeType){var c;c=d.firstChild;var e=p;if(c){do if(e)e.push(c);else if(y(c)){var f=
oa(c,l);f?c=f:e=[c]}else T(c)&&(e=[c]);while(c=c.nextSibling)}if(c=e){e=d.nextSibling;for(f=0;f<c.length;f++)e?a.insertBefore(c[f],e):a.appendChild(c[f])}}while(d=d.nextSibling)}}}};v=b.C(G,"allowedBindings",G.La,"emptyNode",G.da,"insertAfter",G.gb,"prepend",G.ob,"setDomNodeChildren",G.N);m.f=v;b.b("virtualElements",b.f);b.K=function(){this.Ra={};this.clearCache=function(){this.Ra={}}};b.a.j(b.K.prototype,{nodeHasBindings:function(a){return!!this.getBindingsString(a)},getBindings:function(a,b){var c=
this.getBindingsString(a);return c?this.parseBindingsString(c,b):p},getBindingsString:function(a){switch(a.nodeType){case 1:return a.getAttribute("data-bind");case 8:return b.f.qc(a);default:return p}},parseBindingsString:function(a,d){try{var c=d.$data,c="object"==typeof c&&c!=p?[c,d]:[d],e=c.length,f=this.Ra,g=e+"_"+a,h;if(!(h=f[g])){var k,j=" { "+b.w.nb(a,d.$options)+" } ";k=b.a.Eb(j,e);h=f[g]=k}return h(c)}catch(n){K("Unable to parse bindings.\nMessage: "+n+";\nBindings value: "+a)}}});b.K.instance=
new b.K;b.b("bindingProvider",b.K);b.Db={twoWay:1,eventHandler:2,contentBind:16,contentSet:8,contentUpdate:32,noValue:128,twoLevel:4,canUseVirtual:64};b.Fb=function(a){return a.flags&16&&!(a.flags&8)};b.c={};b.F=function(a,d,c,e){var f=this,g="function"==typeof a,h;f.B=h=b.a.D(function(){var k=g?a():a;d?(d.B&&b.q.Y(d.B),b.a.j(f,d),f.B=h,f.$options=b.a.j({},d.$options,c)):(f.$parents=[],f.$root=k,f.$options=b.a.j({},c));f.$data=k;e&&e(f,d,k)})};b.a.j(b.F.prototype,{createChildContext:function(a,d){return new b.F(a,
this,p,function(a,b,f){a.$parentContext=b;a.$parents=b.$parents.slice(0);a.$parents.unshift(a.$parent=b.$data);d&&(a[d]=f)})},extend:function(a){return new b.F(p,this,p,function(d,c){d.$data=c.$data;b.a.j(d,"function"==typeof a?a():a)})}});b.$a=function(a){return b.c[a]||na(a,l)};b.ra=function(a){a.zb=b.ra;return a};var S="needs",ya={flags:512},ta=b.a.z.M();b.tb=function(a,d){if(2==arguments.length)b.n(a,ta,d),d.B&&d.B.$(a);else return b.s(a,ta)};b.Na=function(a,d,c,e){1===a.nodeType&&b.f.kb(a);Y(X(c),
a,l,d,!e)};b.aa=function(a,b){(1===b.nodeType||8===b.nodeType)&&Z(X(a),b,l)};b.Ma=function(a,b,c){b&&(1!==b.nodeType&&8!==b.nodeType)&&K("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");b=b||t.document.body;Y(X(a,c),b,l)};b.ua=function(a){switch(a.nodeType){case 1:case 8:var d=b.tb(a);if(d)return d;if(a.parentNode)return b.ua(a.parentNode)}return C};b.Ib=function(a){return(a=b.ua(a))?a.$data:C};b.b("bindingHandlers",b.c);b.b("bindingFlags",b.Db);
b.b("bindingValueWrap",b.ra);b.b("applyBindings",b.Ma);b.b("applyBindingsToDescendants",b.aa);b.b("applyBindingsToNode",b.Na);b.b("contextFor",b.ua);b.b("dataFor",b.Ib);b.a.e(["click"],function(a){b.c[a]={preprocess:function(b,c,e){e("event."+a,b)},flags:2,init:function(d,c,e,f){return b.c.event.init.call(this,d,function(){var b={};b[a]=c();return b},e,f)}}});b.c.event={flags:6,init:function(a,d,c,e){var f=d()||{},g;for(g in f)(function(){var f=g;"string"==typeof f&&b.a.o(a,f,function(a){var g,j=
d()[f];if(j){try{var m=b.a.H(arguments);m.unshift(e);g=j.apply(e,m)}finally{g!==l&&(a.preventDefault?a.preventDefault():a.returnValue=s)}c(f+"Bubble")===s&&(a.cancelBubble=l,a.stopPropagation&&a.stopPropagation())}})})()}};b.c.submit={flags:2,init:function(a,d,c,e){"function"!=typeof d()&&K("The value for a submit binding must be a function");b.a.o(a,"submit",function(b){var c,h=d();try{c=h.call(e,a)}finally{c!==l&&(b.preventDefault?b.preventDefault():b.returnValue=s)}})}};b.c.visible={update:function(a,
d){var c=b.a.d(d()),e="none"!=a.style.display;c&&!e?a.style.display="":!c&&e&&(a.style.display="none")}};b.c.enable={update:function(a,d){var c=b.a.d(d());c&&a.disabled?a.removeAttribute("disabled"):!c&&!a.disabled&&(a.disabled=l)}};b.c.disable={update:function(a,d){return b.c.enable.update(a,function(){return!b.a.d(d())})}};b.c.value={flags:33,init:function(a,d,c){function e(){var e=d(),f=b.r.t(a);b.w.ma(e,c,"value",f,l)}var f=["change"],g=c("valueUpdate");g&&("string"==typeof g&&(g=[g]),b.a.R(f,
g),f=b.a.Pa(f));if(b.a.ea&&("input"==a.tagName.toLowerCase()&&"text"==a.type&&"off"!=a.autocomplete&&(!a.form||"off"!=a.form.autocomplete))&&-1==b.a.h(f,"propertychange")){var h=s;b.a.o(a,"propertychange",function(){h=l});b.a.o(a,"blur",function(){h&&(h=s,e())})}b.a.e(f,function(c){var d=e;b.a.oc(c,"after")&&(d=function(){setTimeout(e,0)},c=c.substring(5));b.a.o(a,c,d)})},update:function(a,d){var c="select"===b.a.p(a),e=b.a.d(d()),f=b.r.t(a),g=e!=f;0===e&&(0!==f&&"0"!==f)&&(g=l);g&&(f=function(){b.r.la(a,
e)},f(),c&&(e!==b.r.t(a)?b.a.ka(a,"change"):setTimeout(f)))}};b.c.options={flags:24,update:function(a,d,c){"select"!==b.a.p(a)&&K("options binding applies only to SELECT elements");for(var e=b.a.ba(b.a.pa(a.childNodes,function(a){return a.tagName&&"option"===b.a.p(a)&&a.selected}),function(a){return b.r.t(a)||a.innerText||a.textContent}),f=a.scrollTop,g=b.a.d(d());0<a.length;)b.ca(a.options[0]),a.remove(0);if(g){var h=c();"number"!=typeof g.length&&(g=[g]);if(h.optionsCaption){var k=u.createElement("option");
b.a.ha(k,h.optionsCaption);b.r.la(k,C);a.appendChild(k)}c=0;for(d=g.length;c<d;c++){var k=u.createElement("option"),j="string"==typeof h.optionsValue?g[c][h.optionsValue]:g[c],j=b.a.d(j);b.r.la(k,j);var n=h.optionsText,j="function"==typeof n?n(g[c]):"string"==typeof n?g[c][n]:j,j=b.a.d(j);k.appendChild(u.createTextNode(j===p||j===C?"":j));a.appendChild(k)}g=a.getElementsByTagName("option");c=h=0;for(d=g.length;c<d;c++)0<=b.a.h(e,b.r.t(g[c]))&&(b.a.sb(g[c],l),h++);a.scrollTop=f;h<e.length&&b.a.ka(a,
"change");b.a.Pb(a)}}};b.c.options.Ca=b.a.z.M();b.c.selectedOptions={flags:33,cb:function(a){var d=[];a=a.childNodes;for(var c=0,e=a.length;c<e;c++){var f=a[c],g=b.a.p(f);"option"==g&&f.selected?d.push(b.r.t(f)):"optgroup"==g&&(f=b.c.selectedOptions.cb(f),Array.prototype.splice.apply(d,[d.length,0].concat(f)))}return d},init:function(a,d,c){b.a.o(a,"change",function(){var a=d(),f=b.c.selectedOptions.cb(this);b.w.ma(a,c,"value",f)})},update:function(a,d){"select"!=b.a.p(a)&&K("values binding applies only to SELECT elements");
var c=b.a.d(d());if(c&&"number"==typeof c.length)for(var e=a.childNodes,f=0,g=e.length;f<g;f++){var h=e[f];"option"===b.a.p(h)&&b.a.sb(h,0<=b.a.h(c,b.r.t(h)))}}};b.c.text={flags:88,init:function(a){b.f.N(a,[u.createTextNode("")])},update:function(a,d){var c=b.a.d(d());b.f.firstChild(a).data=c===p||c===C?"":c}};b.c.html={flags:24,update:function(a,d){var c=b.a.d(d());b.a.ha(a,c)}};b.c.css={flags:4,update:function(a,d){var c=b.a.d(d());if("object"==typeof c)for(var e in c){var f=b.a.d(c[e]);b.a.ja(a,
e,f)}else c=String(c||""),b.a.ja(a,a.__ko__cssValue,s),a.__ko__cssValue=c,b.a.ja(a,c,l)}};b.c.style={flags:4,update:function(a,d){var c=b.a.d(d()||{}),e;for(e in c)if("string"==typeof e){var f=b.a.d(c[e]);a.style[e]=f||""}}};b.c.uniqueName={flags:128,init:function(a,d){d()&&(a.name="ko_unique_"+ ++b.c.uniqueName.Hb,(b.a.Yb||b.a.Zb)&&a.mergeAttributes(u.createElement("<input name='"+a.name+"'/>"),s))}};b.c.uniqueName.Hb=0;b.c.checked={flags:1,init:function(a,d,c){b.a.o(a,"click",function(){var e;if("checkbox"==
a.type)e=a.checked;else if("radio"==a.type&&a.checked)e=a.value;else return;var f=d();"checkbox"==a.type&&b.a.d(f)instanceof Array?(e=b.a.h(b.a.d(f),a.value),a.checked&&0>e?f.push(a.value):!a.checked&&0<=e&&f.splice(e,1)):b.w.ma(f,c,"checked",e,l)});"radio"==a.type&&!a.name&&b.c.uniqueName.init(a,function(){return l})},update:function(a,d){var c=b.a.d(d());"checkbox"==a.type?a.checked=c instanceof Array?0<=b.a.h(c,a.value):c:"radio"==a.type&&(a.checked=a.value==c)}};var ua={"class":"className","for":"htmlFor"};
b.c.attr={flags:4,update:function(a,d){var c=b.a.d(d())||{},e;for(e in c)if("string"==typeof e){var f=b.a.d(c[e]),g=f===s||f===p||f===C;g&&a.removeAttribute(e);8>=b.a.ea&&e in ua?(e=ua[e],g?a.removeAttribute(e):a[e]=f):g||a.setAttribute(e,f.toString())}}};b.c.withlight={flags:80,preprocess:function(a,b,c){(b=a.match(/^\s*([$\w]+)\s*=\s*([^=][\s\S]*)$/))&&c("withItemName",'"'+b[1]+'"');return b?b[2]:a},init:function(a,d,c,e,f){c=f.createChildContext(function(){return b.a.d(d())},c("withItemName"));
b.aa(c,a)}};b.c.hasfocus={flags:1,init:function(a,d,c){function e(a){var e=d();b.w.ma(e,c,"hasfocus",a,l)}b.a.o(a,"focus",function(){e(l)});b.a.o(a,"focusin",function(){e(l)});b.a.o(a,"blur",function(){e(s)});b.a.o(a,"focusout",function(){e(s)})},update:function(a,d){var c=b.a.d(d());c?a.focus():a.blur();b.a.ka(a,c?"focusin":"focusout")}};var va=b.a.z.M();b.c["with"]={flags:80,init:function(a,d,c,e,f){d=b.a.d(d());c=b.f.childNodes(a);e=b.k(d);d&&(c=b.a.Sa(c),b.aa(f.createChildContext(e),a));b.n(a,
va,{mc:b.a.jb(c),lc:e})},update:function(a,d,c,e,f){c=b.s(a,va);e=c.lc;d=b.a.d(d());e.ga()?(d||b.f.da(a),e(d)):d&&(nodesArray=b.a.Sa(c.mc.childNodes),b.f.N(a,nodesArray),e(d),b.aa(f.createChildContext(e),a))}};b.c["if"]=ba(function(a,b){b["if"]=a});b.c.ifnot=ba(function(a,b){b.ifnot=a});b.c.foreach=ba(function(a,d){!a||"number"==typeof a.length?d.foreach=a:(b.a.j(d,a),d.foreach=d.data,delete d.name)});b.Z=function(){};b.a.j(b.Z.prototype,{renderTemplateSource:function(){K("Override renderTemplateSource")},
createJavaScriptEvaluatorBlock:function(){K("Override createJavaScriptEvaluatorBlock")},makeTemplateSource:function(a,d){if("string"==typeof a){d=d||u;var c=d.getElementById(a);c||K("Cannot find template with ID "+a);return new b.l.g(c)}if(1==a.nodeType||8==a.nodeType)return new b.l.Q(a);K("Unknown template type: "+a)},renderTemplate:function(a,b,c,e){a=this.makeTemplateSource(a,e);return this.renderTemplateSource(a,b,c)},isTemplateRewritten:function(a,b){return this.allowTemplateRewriting===s||!(b&&
b!=u)&&this.fa&&this.fa[a]?l:this.makeTemplateSource(a,b).data("isRewritten")},rewriteTemplate:function(a,b,c){var e=this.makeTemplateSource(a,c);b=b(e.text());e.text(b);e.data("isRewritten",l);!(c&&c!=u)&&"string"==typeof a&&(this.fa=this.fa||{},this.fa[a]=l)}});b.b("templateEngine",b.Z);var Ka=/(<[a-z]+\d*(\s+(?!data-bind=)[a-z0-9\-]+(=(\"[^\"]*\"|\'[^\']*\'))?)*\s+)data-bind=(["'])([\s\S]*?)\5/gi,La=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;b.O={qa:{},Qb:function(a,d,c){d.isTemplateRewritten(a,c)||
d.rewriteTemplate(a,function(a){return b.O.dc(a,d)},c)},dc:function(a,b){return a.replace(Ka,function(a,e,f,g,h,j,w){return la(w,e,b)}).replace(La,function(a,e){return la(e,"\x3c!-- ko --\x3e",b)})},Bb:function(a){return b.W.Aa(function(d,c){d.nextSibling&&b.Na(d.nextSibling,a,c)})}};b.b("bindingRewriteValidators",b.O.qa);b.b("__tr_ambtns",b.O.Bb);b.l={};b.l.g=function(a){this.g=a};b.l.g.prototype.text=function(){var a=b.a.p(this.g),a="script"===a?"text":"textarea"===a?"value":"innerHTML";if(0==arguments.length)return this.g[a];
var d=arguments[0];"innerHTML"===a?b.a.ha(this.g,d):this.g[a]=d};b.l.g.prototype.data=function(a){if(1===arguments.length)return b.s(this.g,"templateSourceData_"+a);b.n(this.g,"templateSourceData_"+a,arguments[1])};b.l.Q=function(a){this.g=a};b.l.Q.prototype=new b.l.g;b.l.Q.prototype.text=function(){if(0==arguments.length){var a=b.s(this.g,"__ko_anon_template__")||{};a.Ja===C&&a.ta&&(a.Ja=a.ta.innerHTML);return a.Ja}b.n(this.g,"__ko_anon_template__",{Ja:arguments[0]})};b.l.g.prototype.nodes=function(){if(0==
arguments.length)return(b.s(this.g,"__ko_anon_template__")||{}).ta;b.n(this.g,"__ko_anon_template__",{ta:arguments[0]})};b.b("templateSources",b.l);b.b("templateSources.domElement",b.l.g);b.b("templateSources.anonymousTemplate",b.l.Q);var W;b.Ga=function(a){a!=C&&!(a instanceof b.Z)&&K("templateEngine must inherit from ko.templateEngine");W=a};b.Ea=function(a,d,c,e,f){c=c||{};(c.templateEngine||W)==C&&K("Set a template engine before calling renderTemplate");f=f||"replaceChildren";if(e){var g=b.a.D(function(){var h=
d&&d instanceof b.F?d:new b.F(b.a.d(d)),j="function"==typeof a?a(h.$data):a,h=ia(e,f,j,h,c);"replaceNode"==f&&(e=h,g&&g.Fa(e))});g&&g.$(e);return g}return b.W.Aa(function(e){b.Ea(a,d,c,e,"replaceNode")})};b.kc=function(a,d,c,e,f){function g(a,b){ja(b,j);c.afterRender&&c.afterRender(b,a)}function h(b,d){var e="function"==typeof a?a(b):a;j=f.createChildContext(b);j.$index=d;return ia(p,"ignoreTargetNode",e,j,c)}var j;return b.a.D(function(){var a=b.a.d(d)||[];"undefined"==typeof a.length&&(a=[a]);a=
b.a.pa(a,function(a){return c.includeDestroyed||a===C||a===p||!b.a.d(a._destroy)});b.a.rb(e,a,h,c,g)},e)};var wa=b.a.z.M();b.c.template={flags:88,init:function(a,d){var c=b.a.d(d());if("string"!=typeof c&&!c.name&&(1==a.nodeType||8==a.nodeType))if(c=new b.l.Q(a),!c.nodes()){var e=b.f.childNodes(a),e=b.a.jb(e);c.nodes(e)}},update:function(a,d,c,e,f){c=b.a.d(d());var g=l;"string"==typeof c?c={name:c}:("if"in c&&(g=g&&b.a.d(c["if"])),"ifnot"in c&&(g=g&&!b.a.d(c.ifnot)));e=c.name||a;d=p;"foreach"in c?
d=b.kc(e,g&&c.foreach||[],c,a,f):g?(f="data"in c?f.createChildContext(c.data):f,d=b.Ea(e,f,c,a)):b.f.da(a);f=d;(c=b.s(a,wa))&&"function"==typeof c.m&&c.m();b.n(a,wa,f);return d}};b.O.qa.template=function(a){a=b.w.mb(a);return 1==a.length&&a[0].unknown||b.w.ac(a,"name")?p:"This template engine does not support anonymous templates nested within its templates"};b.b("setTemplateEngine",b.Ga);b.b("renderTemplate",b.Ea);b.a.Ta=function(a,b){a=a||[];b=b||[];return a.length<=b.length?ha(a,b,"added","deleted"):
ha(b,a,"deleted","added")};b.b("utils.compareArrays",b.a.Ta);var ea=b.a.z.M();b.a.rb=function(a,d,c,e,f){d=d||[];e=e||{};var g=f;f=g?function(a,b,c,d){g(a,b,c);ga(0,b,0,d)}:ga;var h=b.s(a,ea)===C,j=b.s(a,ea)||[],m=b.a.ba(j,function(a){return a.Cb}),n=b.a.Ta(m,d);d=[];for(var v=0,y=[],D=0,m=[],x=p,q=0,r;r=n[q];q++)switch(r.status){case "retained":var A=j[v++];A.fb(D++);d.push(A);0<A.U.length&&(x=A.U[A.U.length-1]);break;case "deleted":if(r.moved===C){var J=j[v];J.i&&J.i.m();b.a.e(Q(J.U),function(a){y.push({P:a,
na:q,oa:r.value});x=a})}++v;break;case "added":var G,E,H;if(r.moved!==C)A=j[r.moved],A.fb(D++),G=Q(A.U),E=l,d.push(A);else{var I=b.k(D++),J=xa(c,H=r.value,f,I);G=J.bc;E=s;d.push({Cb:H,U:G,i:J.i,fb:I})}for(var A=0,L=G.length;A<L;A++){var F=G[A];E||m.push({P:F,na:q,oa:H});x==p?b.f.ob(a,F):b.f.gb(a,F,x);x=F}E||f(H,G,I,J.i)}b.a.e(y,function(a){b.ca(a.P)});c=s;if(!h){if(e.afterAdd)for(q=0;q<m.length;q++)e.afterAdd(m[q].P,m[q].na,m[q].oa);if(e.beforeRemove){for(q=0;q<y.length;q++)e.beforeRemove(y[q].P,
y[q].na,y[q].oa);c=l}}if(!c&&y.length)for(q=0;q<y.length;q++)e=y[q].P,e.parentNode&&e.parentNode.removeChild(e);b.n(a,ea,d)};b.b("utils.setDomNodeChildrenFromArrayMapping",b.a.rb);b.L=function(){this.allowTemplateRewriting=s};b.L.prototype=b.a.j(new b.Z,{renderTemplateSource:function(a){var d=!(9>b.a.ea)&&a.nodes?a.nodes():p;if(d)return b.a.H(d.cloneNode(l).childNodes);a=a.text();return b.a.Da(a)}});b.L.hb=new b.L;b.Ga(b.L.hb);b.b("nativeTemplateEngine",b.L);b.za=function(){var a=this.$b=function(){if("undefined"==
typeof B||!B.tmpl)return 0;try{if(0<=B.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(a){}return 1}();this.renderTemplateSource=function(b,c,e){e=e||{};2>a&&K("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var f=b.data("precompiled");f||(f=b.text()||"",f=B.template(p,"{{ko_with $item.koBindingContext}}"+f+"{{/ko_with}}"),b.data("precompiled",f));b=[c.$data];c=B.extend({koBindingContext:c},e.templateOptions);c=B.tmpl(f,b,c);c.appendTo(u.createElement("div"));
B.fragments={};return c};this.createJavaScriptEvaluatorBlock=function(a){return"{{ko_code ((function() { return "+a+" })()) }}"};this.addTemplate=function(a,b){u.write("<script type='text/html' id='"+a+"'>"+b+"\x3c/script>")};0<a&&(B.tmpl.tag.ko_code={open:"__.push($1 || '');"},B.tmpl.tag.ko_with={open:"with($1) {",close:"} "})};b.za.prototype=new b.Z;m=new b.za;0<m.$b&&b.Ga(m);b.b("jqueryTmplTemplateEngine",b.za)}
"function"===typeof require&&"object"===typeof exports&&"object"===typeof module?V(module.exports||exports):"function"===typeof define&&define.amd?define(["exports"],V):V(t.ko={});
})();
